<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		请选择：<select id="pro"></select>省<select id="city"></select>市
		<script type="text/javascript">
			
			let provinces=[]
			let pro = document.getElementById("pro")
			let city = document.getElementById("city")
			function init(){
				let xhr =new XMLHttpRequest();
				xhr.open("GET","cities.json",false);
				xhr.send();
				var data = xhr.responseXML;
				provinces =JSON.parse(data)
				for (var i = 0; i < provinces.length; i++) {
					pro.provinces[i] = new Option(provinces[i].name)
					
				}
				for (var j = 0; j < provinces[0].city.length; j++) {
						city.options[j] = new Option(provinces[0].city[j])
					}
				}
		</script>
	</body>
</html>
